package com.ruoyi.cms.type.controller;


import com.ruoyi.cms.article.service.ICmsArticleService;
import com.ruoyi.cms.type.domain.CmsType;
import com.ruoyi.cms.type.service.ICmsTypeService;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController("SiteCmsTypeController")
@RequestMapping("/site/cms/type")
public class CmsTypeController {

//    @Resource
//    private ICmsArticleService cmsArticleService;


    @Resource
    private ICmsTypeService cmsTypeService;


    /**
     * 根据typeId查询父级id的列表
     *
     * @param typeId
     * @return
     */
    @GetMapping("/path/{typeId}")
    private AjaxResult selectTypePath(@PathVariable("typeId") Long typeId) {
        CmsType cmsType = cmsTypeService.selectCmsTypeByTypeId(typeId);
        return AjaxResult.success(cmsType);
    }
}
